ARG PYTORCH="1.6.0"
ARG CUDA="10.1"
ARG CUDNN="7"

FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel

ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0+PTX"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 'A4B469963BF863CC'

RUN  apt-get update
ENV TIME_ZONE Asia/Shanghai
ENV DEBIAN_FRONTEND=noninteractive
RUN adduser --quiet --disabled-password qtuser && usermod -a -G audio qtuser
ENV  LIBGL_ALWAYS_INDIRECT=1

RUN  apt-get install ffmpeg  -y
RUN  apt-get install ninja-build  -y
RUN  apt-get install libglib2.0-0  -y
RUN  apt-get install libsm6 -y
RUN  apt-get install libxrender-dev -y
RUN  apt-get install libxext6 -y

RUN  apt-get upgrade -y
RUN  apt-get install      libgl1-mesa-glx -y
RUN  apt-get install      libxss1 -y
RUN  apt-get install      libappindicator1 -y
RUN  apt-get install      libindicator7 -y
RUN  apt-get install      libjpeg8-dev -y
RUN  apt-get install      libpng-dev -y
RUN  apt-get install      libtiff5-dev -y
RUN  apt-get install      zlib1g-dev -y
RUN  apt-get install      libleptonica-dev -y
RUN  apt-get install      libtesseract-dev -y
RUN  apt-get install      tesseract-ocr -y
RUN  apt-get install      fonts-liberation -y
RUN  apt-get install      libappindicator3-1 -y
RUN  apt-get install      libasound2 -y
RUN  apt-get install      libnspr4 -y
RUN  apt-get install      libnss3 -y
RUN  apt-get install      xdg-utils -y
RUN  apt-get install      libcanberra-gtk-module -y
RUN  apt-get install      tcl-dev -y
RUN  apt-get install      tk-dev -y
RUN  apt-get install      python3-tk -y
RUN  apt-get install      dbus -y
RUN  apt-get install      locales -y
RUN  apt-get install      ttf-wqy-microhei -y
RUN  apt-get install      language-pack-zh-hans -y

# Install mmcv-full
RUN pip install mmcv-full==1.6.0 -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html
RUN pip install mmdet -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
RUN pip install decord>=0.4.1 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
RUN pip install einops -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
RUN pip install matplotlib -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
RUN pip install numpy -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
RUN pip install opencv-contrib-python -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
RUN pip install Pillow -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
RUN pip install scipy -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
RUN pip install PyQt5 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

RUN  apt-get install  python3-pyqt5 -y
#sudo docker build -t='bewithmeallmylife/mmaction2-runtime:1.0.0' .